import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Scanner;


public class ACMOj {
	
	private FileInputStream instream = null;
    private PrintStream outstream = null;
    private Scanner in = null;
    private String buffer = "";
    private int index = 0;
	
	public ACMOj(String inputFile,String outputFile) throws FileNotFoundException
	{
		instream = new FileInputStream(inputFile);
        outstream = new PrintStream(outputFile);
        System.setIn(instream);
        System.setOut(outstream);
        in = new Scanner(System.in);
	}
	
	public int nextInt()
	{
		return in.nextInt();
	}
	
	public String next()
	{
		return in.next();
	}
	
	public String nextLine()
	{
		return in.nextLine();
	}
	
	public char nextChar()
	{
		if(index == buffer.length())
		{
			if(in.hasNext())
			{
				buffer = in.next();
				index = 0;
			}
			else
				return (char)-1;
		}
		
		return buffer.charAt(index++);
	}
}
